package leetcode.code2315;

public class Solution {
	public int countAsterisks(String s) {
		int ans = 0, f = 0;
		for (char c : s.toCharArray()) {
			if (c == '*' && f == 0) {
				ans++;
			} else if (c == '|') {
				f ^= 1;
			}
		}
		return ans;
	}
}
